<template>
	<view class="container">
	
		<view class="bg-view">
			<view class="bg_box">
				<!-- 顶部状态栏 -->
				<view class="top-nav"
					:style="'height:' + (titleBarHeight+titleBarHeight) + 'px;position:fixed;top:0;width:100vw;'">
					<view class="status_nav"
						:style="'height:' + statusBarHeight + 'px;position:fixed;top:0;width:100vw;'"></view>
					<view class="left-button-box" :style="'height:'+ titleBarHeight +'px;top:'+ statusBarHeight +'px;'"
						@click="tapToBack('back')">
						<image src="../../static/back.png" mode="aspectFill"></image>
					</view>
					<view
						:style="'height:'+ titleBarHeight +'px;line-height:'+ titleBarHeight + 'px;top:'+ statusBarHeight +'px;position:fixed;width:100vw;'"
						class="Index_tab_top">
						<view class="mine-txt"></view>
					</view>
				</view>
				<view :style="'width: 100vw;height:'+(titleBarHeight+titleBarHeight)+'px;'"></view>
	
			</view>
	
			<image src="https://imgs.ynz666.com/2025/05/20/YTFlOWNiOGU3NTdjMmYzOGE2MzI5ZWJjZTY4ZjY5ZTk=.png"
				mode="widthFix" class="bg-image" style="border-bottom: 100px solid #ffe6a1;"></image>
			<!-- <view class="title">
				- 本活动最终解释权归下楼科技所有 -
			</view> -->
		</view>
			<view class="cont">

				
				
				<view class="foot">
					<view class="btn">
						<view class="btn_box">
							<view class="view1" @click="jumpIdentityInfo(navOneList[0].id,1)">
								销氪礼包
							</view>
							<view class="view1" @click="jumpIdentityInfo(navOneList[1].id,2)">
								服务商礼包
							</view>
						</view>
					</view>
				</view>
			</view>





		</view>
</template>

<script>
	var app = getApp();
	import http from '@/utils/request/http.js';
	import env from '@/env/index.js';


	import {
		getInviteLatest,
		getShareInvitePage,
		apiEmbeddingPointAdd
	} from '../../apis/index.js';
	
	
	import {
		apiPointSeuityList,apiOperationMemberCard
	} from '../../apis/my.js';
	
	export default {
		data() {
			return {
				statusBarHeight: 0,
				titleBarHeight: 0,
				bottomTabbar: 0,
				menuButtonInfo: {},
				mineInfo: {},



				myInfo: {},
				cardId:'',
				type:'',
				navOneList:[],
			}
		},
		onShareAppMessage(res) {
			return {
				title: '',
				imageUrl: '',
				path: `/pageB/giftBagInfo/giftBagInfo?cardId=${this.cardId}`
			}
		},
		onLoad(options) {
			console.log(options, "options")
			
			this.cardId=options.cardId
			this.type=options.type
			
		},
		onShow() {
			let that = this
      this.getUserInfo();
			this.operationMemberCard();
		},
		onReady() {
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
			this.titleBarHeight = (uni.getMenuButtonBoundingClientRect().top - this.statusBarHeight) * 2 + uni
				.getMenuButtonBoundingClientRect().height;
			this.bottomTabbar = uni.getStorageSync('bottomTabbar');
			this.menuButtonInfo = uni.getMenuButtonBoundingClientRect();
		},
		methods: {
			// 获取逍客价格列表
			operationMemberCard(){
				apiOperationMemberCard({show:"agent"}).then(res=>{
					this.navOneList=res.data.list
				})
			},
			jumpIdentityInfo(id,type){
				uni.navigateTo({
					url: `/pageB/giftBagInfo/giftBagInfo?cardId=${id}&type=${type}`
				})
			},
			getUserInfo() {
				let that = this;
				app.getUserInfo(function(lRes) {
					that.mineInfo = lRes;
					that.distribution=lRes.distribution
					that.loading=false
					uni.setStorageSync('mineInfo', lRes);
				})
			},
			// 返回按钮
			tapToBack(page) {
				switch (page) {
					case 'index':
						uni.switchTab({
							url: '/pages/index/index'
						})
						break;
					case 'back':
						console.log(111)
						uni.navigateBack({
							delta: 1,
							fail() {
								console.log(222)
								uni.switchTab({
									url: '/pages/index/index'
								})
							}
						})
						break;
				}
			},
			jumpIndex() {
				uni.switchTab({
					url: '/pages/index/index',
				})
			},
			
			// 手机号授权
			onGetPhoneNumber(e) {
				let that = this;
				app.GetMobile(e, function(e) {
					app.getUserInfo(function(lRes) {
						that.mineInfo = lRes;
					})
				});
			},
			// 立即领取
			drawDown() {
				
			},
		}
	}
</script>

<style lang="scss">
	page {
		padding-bottom: 300rpx;
	}
	.left-button-box {
		display: flex;
		align-items: center;
		position: absolute;
		left: 30rpx;
		z-index: 7;
	
		.line {
			height: 30rpx;
			background: #CCCCCC;
			width: 1rpx;
		}
	
		image {
			width: 30rpx;
			height: 30rpx;
			margin: 0 20rpx;
		}
	}
	/* 背景 */
	.bg-view {
		width: 100vw;
		height: 1100rpx;

		.bg_box {
			height: 1100rpx;
			// background: linear-gradient(180deg, #F77539 0%, #FEFDFB 100%);
		}

		.bg-image {
			z-index: -1;
			display: block;
			width: 100%;
			height: 1100rpx;
			position: absolute;
			top: 0;
			left: 0;
		}
	}

	.cont {
		width: 100%;
		// height: 2845rpx;
		padding-bottom: 150rpx;
		// background: linear-gradient(90deg, #FC5439 0%, #FD663F 100%);
		// margin-top: -95rpx;

		.main {
			margin: 0 40rpx 40rpx;
			padding-bottom: 22rpx;
			background: #FFE7C4;
			border-radius: 20rpx;
			position: relative;

			.main_title {
				height: 20rpx;
			}

			.main_box {
				width: 630rpx;
				background: #FFF7EC;
				box-shadow: 0px 0px 5rpx 0px #FFE08E;
				border: 1rpx solid #FDD45D;
				margin: 0 20rpx;
				padding-bottom: 28rpx;

				.top {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 340rpx;
					height: 68rpx;
					background: #FF5B40;
					border-radius: 0px 0px 10rpx 10rpx;
					font-size: 28rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #FFFFFF;
					margin-left: 145rpx;
				}

				.bottom {
					margin: 44rpx 44rpx 0;
					line-height: 50rpx;

					.item {
						font-size: 26rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #333333;

						text {
							font-weight: bold;
							color: rgba(253, 59, 62, 1);
						}
					}
				}

				.m_foot {
					margin: 30rpx 44rpx 0;
					display: flex;
					flex-wrap: wrap;
					justify-content: space-between;

					.item {
						width: 242rpx;
						height: 240rpx;
						background: #FFFFFF;
						border-radius: 20rpx;
						overflow: hidden;
						display: flex;
						flex-direction: column;
						margin-bottom: 40rpx;

						.img {
							width: 100%;
							height: 144rpx;
						}

						.item_box {
							width: 100%;
							height: 96rpx;
							background: #FFFFFF;

							.v1 {
								font-size: 24rpx;
								font-family: PingFangSC-Medium, PingFang SC;
								font-weight: 500;
								color: #E64E1F;
								padding: 17rpx 10rpx 0;
							}

							.v2 {
								font-size: 21rpx;
								font-family: PingFangSC-Medium, PingFang SC;
								font-weight: 500;
								color: rgba(102, 102, 102, 1);
								padding: 4rpx 10rpx 0;
							}
						}
					}
				}
			}

			.dw {
				width: 112rpx;
				height: 105rpx;
				position: absolute;
				left: -28rpx;
				bottom: -45rpx;
				z-index: 10;
			}

			.dw2 {
				width: 107rpx;
				height: 96rpx;
				position: absolute;
				right: -28rpx;
				top: -28rpx;
				z-index: 10;
			}

			.dw3 {
				width: 124rpx;
				height: 118rpx;
				position: absolute;
				left: -39rpx;
				bottom: -45rpx;
				z-index: 10;
			}
		}
	}

	.foot {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		margin-top: 32rpx;
		// padding-bottom: 52rpx;
		position: fixed;
		bottom: 50rpx;

		.btn {
			height: 120rpx;
			font-size: 28rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #F43B00;
			position: relative;
			width: 640rpx;

			.btn_box {
				height: 120rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.view1 {
					width: 300rpx;
					height: 120rpx;
					background: linear-gradient(180deg, #FCDF8D 0%, #FC952C 100%);
					border-radius: 60rpx;
					border: 2rpx solid #FFFFFF;
					display: flex;
					align-items: center;
					justify-content: center;
					flex-direction: column;
				}

				.text1 {
					font-size: 22rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
				}

				.btn_sha {
					width: 520rpx;
					height: 120rpx;
					border-radius: 28rpx 0px 0px 28rpx;
					position: absolute;
					top: 0;
					left: 0;
					opacity: 0;
					border: 1rpx solid red;
				}
			}
		}

		.btn_pho {
			width: 100%;
			height: 100%;
			position: absolute;
			top: 0;
			left: 0;
			opacity: 0;
		}

		.text {
			font-size: 24rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			margin-top: 16rpx;
			text-decoration: underline;
		}
	}
</style>
